package com.wfm.leetcode.editor.cn;
public class PSix33平方数之和{
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public boolean judgeSquareSum(int c) {
        long l = 0;
        long r = (long)Math.sqrt(c);
        while (l<=r){
            long sum = l*l+r*r;
            if(sum==c){
                return true;
            }else if(sum<c){
                l++;
            }else {
                r--;
            }
        }
        return false;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

    public static void main(String[] args) { 
        Solution solution = new PSix33平方数之和().new Solution();
    }
}